package com.szlizarrrr.demo.optional;

import java.util.Date;

import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractEntity {
	
	@Id @GeneratedValue Long id;
	
	@Temporal(TemporalType.TIMESTAMP)
	@CreatedDate 
	Date createDate;

	@Temporal(TemporalType.TIMESTAMP)
	@LastModifiedDate 
	Date modifiedDate;

}
